<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Help - Gentoo Chroot</title>
        <link href="/webman/help/help.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <h1>Gentoo Chroot</h1>
        <p><a href="http://www.gentoo.org/">Gentoo</a> is a free operating system based on either Linux or FreeBSD that can be automatically optimized and customized for just about any application or need. Gentoo Chroot allows you to install the Gentoo OS inside your DiskStation, alongside DSM.  <em>This package is intended for advanced users only</em>.</p>
        <h2>Installation</h2>
	<p>Once the <em>package</em> installation has finished in the Package Center, the installation of the <em>chroot environment</em> continues in the background. Open <b>Gentoo Chroot</b> from the <b>Main Menu</b> of DSM and you can see its status under <b>Overview</b> in the left pane. When the installation finishes, the status will automatically change to <b>Installed</b>.</p>
	<h3>Initial Setup</h3>
        <p>Due to the custom nature of Gentoo, this package installs a very minimal Gentoo installation to your DiskStation and leaves the setup and configuration up to you.</p>
        <p>As soon as the status of the <em>chroot environment</em> is <b>Installed</b>, you can begin configuring your new installation of Gentoo. To do so, connect to the DiskStation through SSH (root user) and use the following commands:</p>
        <ol>
            <li><code>/var/packages/gentoo-chroot/scripts/start-stop-status start</code></li>
            <li><code>/var/packages/gentoo-chroot/scripts/start-stop-status chroot</code></li>
            <li><code>env-update</code></li>
            <li><code>source /etc/profile</code></li>
            <li><code>export PS1="(chroot) $PS1"</code></li>
        </ol>
        <p>Unless you know what you are doing, it is <em>strongly</em> recommended that you to continue the setup of your installation of Gentoo by following from the relevant section of the official Gentoo handbook: <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=6#doc_chap2">here</a>.</p>
        <h2>App Usage</h2>
	<h3>Overview</h3>
        <p>From the Gentoo Chroot app, you can monitor how many services are running, perform update operations and manage services.</p>
	<h3>Updates</h3>
	<p>Gentoo uses <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1">Portage</a> to handle package updates.</p>
	<p>Again, due to the custom nature of Gentoo, usually it's best to perform package updates via the command-line interface to Portage: <code><a href="http://dev.gentoo.org/~zmedico/portage/doc/man/emerge.1.html">emerge</a></code>. As <code>emerge</code> generally provides a greater amount of control over the packages that are installed and updated in your installation of Gentoo, wherever possible it's advisable to update your Gentoo installation manually using via the command-line.</p>
	<p>If you just want to quickly check for available updates for Gentoo, simply click <b>Update</b> and Portage will sync with the package tree, then inform you of how many updates are available.</p>
	<p>Whilst it's generally better to update Gentoo via the command-line, you can perform a quick update by simply clicking <b>Update</b>.</p>
        <h3>Services</h3>
        <p>Gentoo Chroot allows you to manage the packages you installed in the chroot directly from DSM.</p>
        <p>Under <b>Services</b> in the left pane, you can manage services that you manually installed previously in the chroot: start and stop them easily.</p>
        <h4>Configuration</h4>
        <ol>
            <li>Manually install in the chroot the service you chose.</li>
            <li>Configure it by editing the correct configuration files.</li>
            <li>In the interface, click on <b>Add</b> and fill the form. The <b>Launch script</b> will be launched with the <code>start</code> argument to start the service and <code>stop</code> to stop it. The <b>Status command</b> should return exit code <code>0</code> (success) if the service is started, or <code>>0</code> (error) if it is stopped.</li>
        </ol>
        <h4>Example: SSH Server</h4>
        <ol>
            <li>Edit the configuration file: <code>/etc/ssh/sshd_config</code>.</li>
            <li>Change the port number and other things if necessary.</li>
            <li>Click on <b>Add</b> and put the name <code>SSHD</code>, the launch script <code>rc-service sshd</code> and the status command <code>rc-service sshd status</code>.</li>
        </ol>
    </body>
</html>
